Add an example of iconic rendering
authorMatthias Clasen <mclasen@redhat.com>
Wed, 2 Apr 2014 05:08:39 +0000 (01:08 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 28 Apr 2014 18:20:27 +0000 (14:20 -0400)
testpopover now shows several examples of icon buttons.

https://bugzilla.gnome.org/show_bug.cgi?id=727477

tests/popover.ui
tests/testpopover.c

index 74ffdb9b9a6876e76d026095f95891afc9ecd1fa..74fa0bfadb56546d5b06af78e1e7d2067e0c81c7 100644 (file)
@@ -1,5 +1,23 @@
 <interface>
   <menu id="menu">
+    <section>
+      <attribute name="display-hint">horizontal-buttons</attribute>
+      <item>
+        <attribute name="label">Cut</attribute>
+        <attribute name="action">top.cut</attribute>
+        <attribute name="verb-icon">edit-cut-symbolic</attribute>
+      </item>
+      <item>
+        <attribute name="label">Copy</attribute>
+        <attribute name="action">top.copy</attribute>
+        <attribute name="verb-icon">edit-copy-symbolic</attribute>
+      </item>
+      <item>
+        <attribute name="label">Paste</attribute>
+        <attribute name="action">top.paste</attribute>
+        <attribute name="verb-icon">edit-paste-symbolic</attribute>
+      </item>
+    </section>
     <section>
       <item>
         <attribute name="label">No action</attribute>
           <attribute name="label">Item 5b</attribute>
           <attribute name="action">top.action5</attribute>
         </item>
+        <section>
+          <attribute name="display-hint">horizontal-buttons</attribute>
+          <item>
+            <attribute name="label">List</attribute>
+            <attribute name="action">top.set-view</attribute>
+            <attribute name="target">list</attribute>
+            <attribute name="verb-icon">view-list-symbolic</attribute>
+          </item>
+          <item>
+            <attribute name="label">Grid</attribute>
+            <attribute name="action">top.set-view</attribute>
+            <attribute name="target">grid</attribute>
+            <attribute name="verb-icon">view-grid-symbolic</attribute>
+          </item>
+        </section>
         <item>
           <attribute name="label">Item 5c</attribute>
           <attribute name="action">top.action5</attribute>
           <attribute name="action">top.action5</attribute>
         </item>
       </section>
+      <section>
+        <attribute name="display-hint">horizontal-buttons</attribute>
+        <attribute name="label">Format</attribute>
+        <item>
+          <attribute name="label">Bold</attribute>
+          <attribute name="action">top.bold</attribute>
+        </item>
+        <item>
+          <attribute name="label">Italic</attribute>
+          <attribute name="action">top.italic</attribute>
+          <attribute name="verb-icon">format-text-italic-symbolic</attribute>
+        </item>
+        <item>
+          <attribute name="label">Strikethrough</attribute>
+          <attribute name="action">top.strikethrough</attribute>
+          <attribute name="verb-icon">format-text-strikethrough-symbolic</attribute>
+        </item>
+        <item>
+          <attribute name="label">Underline</attribute>
+          <attribute name="action">top.underline</attribute>
+          <attribute name="verb-icon">format-text-underline-symbolic</attribute>
+        </item>
+      </section>
       <section>
         <attribute name="label">6666</attribute>
         <item>
index f602daab0af537f93dcf31e074e434c3c1143d9d..2f80e31da054eb858656649385b1c64cf73260a9 100644 (file)
@@ -9,6 +9,14 @@ activate (GSimpleAction *action,
 }
 
 static GActionEntry entries[] = {
+  { "cut", activate, NULL, NULL, NULL },
+  { "copy", activate, NULL, NULL, NULL },
+  { "paste", activate, NULL, NULL, NULL },
+  { "bold", NULL, NULL, "false", NULL },
+  { "italic", NULL, NULL, "false", NULL },
+  { "strikethrough", NULL, NULL, "false", NULL },
+  { "underline", NULL, NULL, "false", NULL },
+  { "set-view", NULL, "s", "'list'", NULL },
   { "action1", activate, NULL, NULL, NULL },
   { "action2", NULL, NULL, "true", NULL },
   { "action2a", NULL, NULL, "false", NULL },